class Api::V1::BonusRecordsController < Api::V1::BaseController
  def index
    @bonus_records = @current_user.bonus_records
    if params[:give_at].presence
      @bonus_records = @bonus_records.between_times(params[:give_at].to_date.beginning_of_calendar_month, params[:give_at].to_date.end_of_calendar_month, field: :give_at)
    end
    @bonus_records = @bonus_records.order("give_at DESC").page(params[:page]).per(params[:per])
  end
end
